import { systemsettingsMap } from '@/configs/app'
import cryptoJs from 'crypto-js'

export const encryptionTools = {
  /** 简单对称加密 */
  encrypt(data: string) {
    return cryptoJs.AES.encrypt(data, systemsettingsMap.cryptSecretKey).toString()
  },
  /** 简单对称解密 */
  decrypt(data: string) {
    return cryptoJs.AES.decrypt(data, systemsettingsMap.cryptSecretKey).toString(cryptoJs.enc.Utf8)
  }
}
